Component({
  data: {
    list: [
      {
        "pagePath": "/pages/Main/Main",
        "text": "首页",
        "iconPath": "/image/icon_main_nocheck.png",
        "selectedIconPath": "/image/icon_main.png"
      },
      {
        "pagePath": "/pages/Ocr/Ocr",
        "text": "识别",
        "iconPath": "/image/icon_pz_nocheck.png",
        "selectedIconPath": "/image/icon_pz.png"
      },
      {
        "pagePath": "/pages/Mine/Mine",
        "text": "我的",
        "iconPath": "/image/icon_me_nocheck.png",
        "selectedIconPath": "/image/icon_me.png"
      }
    ],
    active: 0
  },
  lifetimes: {
    // ready() {
    //   const query = wx.createSelectorQuery().in(this);
    //   query.select('.tabbar').boundingClientRect(res => {
    //     if (res) {
    //       console.log('TabBar 宽度:', res.width);
    //       console.log('TabBar 高度:', res.height);
    //     }
    //   }).exec();
    // }
  },
  methods: {
    switchTab(e) {
      const { index, path } = e.currentTarget.dataset;
      console.log(path)
      this.setData({ active: index });
      wx.reLaunch({
        url: path
      });
    }
  }
});